<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 * @version    $Id: Controller.php 9806 2012-10-30 23:54:12Z matthew $
 * @author     John
 */

/**
 * @category   Application_Core
 * @package    Activity
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 */
class Country_Widget_JoinCountryController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $subject = null;
     if( Engine_Api::_()->core()->hasSubject() ) {
       // Get subject
       $subject = Engine_Api::_()->core()->getSubject();
      
     }
     if (!$subject) {
        return $this->setNoRender();
     }
     $viewer = Engine_Api::_()->user()->getViewer();
     
     $memberTable = Engine_Api::_()->getDbtable('countrymembers','country');
     $status = $memberTable->getStatusMember($viewer->user_id, $subject->country_id);
     
     $this->view->country = $subject;
     $this->view->user = $viewer;
     $this->view->status = $status;
  }
}
